/*
 * XML Type:  XTextRange
 * Namespace: http://www.seedwill.com/xul/widget/
 * Java type: com.seedwill.xul.widget.XTextRange
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.widget.impl;
/**
 * An XML XTextRange(@http://www.seedwill.com/xul/widget/).
 *
 * This is a complex type.
 */
public class XTextRangeImpl extends com.seedwill.xul.widget.impl.XInputImpl implements com.seedwill.xul.widget.XTextRange
{
    private static final long serialVersionUID = 1L;
    
    public XTextRangeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TXTELEMENT$0 = 
        new javax.xml.namespace.QName("", "txtElement");
    private static final javax.xml.namespace.QName MAX$2 = 
        new javax.xml.namespace.QName("", "max");
    private static final javax.xml.namespace.QName MIN$4 = 
        new javax.xml.namespace.QName("", "min");
    private static final javax.xml.namespace.QName STEP$6 = 
        new javax.xml.namespace.QName("", "step");
    
    
    /**
     * Gets array of all "txtElement" elements
     */
    public com.seedwill.xul.widget.XTextBox[] getTxtElementArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(TXTELEMENT$0, targetList);
            com.seedwill.xul.widget.XTextBox[] result = new com.seedwill.xul.widget.XTextBox[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "txtElement" element
     */
    public com.seedwill.xul.widget.XTextBox getTxtElementArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XTextBox target = null;
            target = (com.seedwill.xul.widget.XTextBox)get_store().find_element_user(TXTELEMENT$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "txtElement" element
     */
    public int sizeOfTxtElementArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TXTELEMENT$0);
        }
    }
    
    /**
     * Sets array of all "txtElement" element
     */
    public void setTxtElementArray(com.seedwill.xul.widget.XTextBox[] txtElementArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(txtElementArray, TXTELEMENT$0);
        }
    }
    
    /**
     * Sets ith "txtElement" element
     */
    public void setTxtElementArray(int i, com.seedwill.xul.widget.XTextBox txtElement)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XTextBox target = null;
            target = (com.seedwill.xul.widget.XTextBox)get_store().find_element_user(TXTELEMENT$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(txtElement);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "txtElement" element
     */
    public com.seedwill.xul.widget.XTextBox insertNewTxtElement(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XTextBox target = null;
            target = (com.seedwill.xul.widget.XTextBox)get_store().insert_element_user(TXTELEMENT$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "txtElement" element
     */
    public com.seedwill.xul.widget.XTextBox addNewTxtElement()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XTextBox target = null;
            target = (com.seedwill.xul.widget.XTextBox)get_store().add_element_user(TXTELEMENT$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "txtElement" element
     */
    public void removeTxtElement(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TXTELEMENT$0, i);
        }
    }
    
    /**
     * Gets the "max" element
     */
    public java.lang.String getMax()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MAX$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "max" element
     */
    public org.apache.xmlbeans.XmlString xgetMax()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(MAX$2, 0);
            return target;
        }
    }
    
    /**
     * True if has "max" element
     */
    public boolean isSetMax()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MAX$2) != 0;
        }
    }
    
    /**
     * Sets the "max" element
     */
    public void setMax(java.lang.String max)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MAX$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(MAX$2);
            }
            target.setStringValue(max);
        }
    }
    
    /**
     * Sets (as xml) the "max" element
     */
    public void xsetMax(org.apache.xmlbeans.XmlString max)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(MAX$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(MAX$2);
            }
            target.set(max);
        }
    }
    
    /**
     * Unsets the "max" element
     */
    public void unsetMax()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MAX$2, 0);
        }
    }
    
    /**
     * Gets the "min" element
     */
    public java.lang.String getMin()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MIN$4, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "min" element
     */
    public org.apache.xmlbeans.XmlString xgetMin()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(MIN$4, 0);
            return target;
        }
    }
    
    /**
     * True if has "min" element
     */
    public boolean isSetMin()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MIN$4) != 0;
        }
    }
    
    /**
     * Sets the "min" element
     */
    public void setMin(java.lang.String min)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MIN$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(MIN$4);
            }
            target.setStringValue(min);
        }
    }
    
    /**
     * Sets (as xml) the "min" element
     */
    public void xsetMin(org.apache.xmlbeans.XmlString min)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(MIN$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(MIN$4);
            }
            target.set(min);
        }
    }
    
    /**
     * Unsets the "min" element
     */
    public void unsetMin()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MIN$4, 0);
        }
    }
    
    /**
     * Gets the "step" element
     */
    public java.lang.String getStep()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(STEP$6, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "step" element
     */
    public org.apache.xmlbeans.XmlString xgetStep()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(STEP$6, 0);
            return target;
        }
    }
    
    /**
     * True if has "step" element
     */
    public boolean isSetStep()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(STEP$6) != 0;
        }
    }
    
    /**
     * Sets the "step" element
     */
    public void setStep(java.lang.String step)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(STEP$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(STEP$6);
            }
            target.setStringValue(step);
        }
    }
    
    /**
     * Sets (as xml) the "step" element
     */
    public void xsetStep(org.apache.xmlbeans.XmlString step)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(STEP$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(STEP$6);
            }
            target.set(step);
        }
    }
    
    /**
     * Unsets the "step" element
     */
    public void unsetStep()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(STEP$6, 0);
        }
    }
}
